package com.iflysse.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import com.iflysse.dao.UserInfoDao;
import com.iflysse.dto.updateUserInfoDto;
import com.iflysse.service.UserInfoService;
import com.iflysse.upload.UploadTran;

@Service
public class UserInfoServiceImpl implements UserInfoService{

	@Autowired
	private UserInfoDao userInfoDao;

	@Override
	public int updateUserInfo(updateUserInfoDto dto) {	
		return userInfoDao.updateUserInfo(dto);
	}

	@Override
	public int updateUserHeadImage(MultipartFile headImagePath, String id, String role,String uploadPath) {
		//处理上传图片   获取本地图片路径
		String imagePath=UploadTran.getInstance().transformatiom(headImagePath,uploadPath);
		return userInfoDao.updateUserHeadImage(imagePath, id, role);
	}

}
